package controller.action;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class CheckSessionAction implements Action {

	@Override
	public String process(HttpServletRequest request,
			HttpServletResponse response) throws Exception {
		System.out.println(request.getSession().getAttribute("userid"));
		response.setHeader("command", "checksession");
		if(request.getSession().getAttribute("userid")!=null){
			response.setHeader("userid", "test");
			return "valid";
		}else{
			return "invalid";
		}
	}
}
